Guided Practice 7.1

Design the following function

;; diff : NonEmptyListOfNumber -> Number
;; GIVEN: a nonempty list of numbers
;; RETURNS: the result of subtracting the numbers, from left to right.
;; EXAMPLE:
;; (diff (list 10 5 3)) = 2

;; Hints:  

;; Use the data definition

;; NonEmptyListOfNumber = (cons Number ListOfNumber)

;; You will need one function for the whole list, and one for the
;; ListOfNumber.

;; Your function for the ListOfNumber must follow the template for
;; ListOfNumber, but you will need a context argument.  Think carefully
;; about what the context argument means.

[Solution]


Last modified: Mon Oct 6 22:33:07 Eastern Daylight Time 2014